package y2017.date0326am.强转对象;

import java.util.ArrayList;
import java.util.List;

public class Teacher extends Person {

    private List<String> teachClassNameList;

    public List<String> getTeachClassName() {
        teachClassNameList = new ArrayList<>();
        return teachClassNameList;
    }

    public void setTeachClassName(List<String> teachClassNameList) {
        this.teachClassNameList = teachClassNameList;
    }

    public void addTeachClassName(String teachClassName) {
        if (teachClassNameList == null) {
            teachClassNameList = new ArrayList<String>();
        }
        teachClassNameList.add(teachClassName);
    }

    public void addTeachClassName(List<String> teachClassNames) {
        if (teachClassNameList == null) {
            teachClassNameList = new ArrayList<String>();
        }
        teachClassNameList.addAll(teachClassNames);
    }

    @Override
    public String toString() {
        return "Teacher [teachClassNameList=" + teachClassNameList
                + ", getTeachClassName()=" + getTeachClassName()
                + ", getSpecies()=" + getSpecies() + ", getSex()=" + getSex()
                + ", toString()=" + super.toString() + ", getName()="
                + getName() + ", getYear()=" + getYear() + ", getClass()="
                + getClass() + ", hashCode()=" + hashCode() + "]";
    }

}
